package com.bwie.system.controller;

import com.bwie.common.domain.GoodsType;
import com.bwie.common.domain.Huo;
import com.bwie.common.domain.Type;
import com.bwie.common.result.Result;
import com.bwie.system.service.XiaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("xia")
@CrossOrigin
public class XiaController {


    @Autowired
    XiaService xiaService;


    @GetMapping("type/{typeId}")
    public Result type(){
      List<Type>  typeList=xiaService.type();
      return Result.success(typeList);
    }


    @GetMapping("goodstype/{goodstypeId}")
    public Result goodstype(){
           List<GoodsType> goodsTypes= xiaService.goodstype();
           return Result.success(goodsTypes);
    }

    @GetMapping("huo/{huoId}")
    public Result huo(){
        List<Huo> huoList= xiaService.huo();
        return Result.success(huoList);
    }
}
